Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add wrapper for GitHub Actions #437

Merged
merged 35 commits into from
Feb 15, 2022

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Feb 11, 2022

🧰 Changes

This finally does what we've been talking about for months and adds an extremely lightweight wrapper around this repo so we can have first-class support for GitHub Actions 🚀

You can check out action.yml for all the heavy lifting.

Here's how uploading an OpenAPI file looks with npx vs. the GitHub Action:

# npx
- run: npx -y rdme@6 openapi openapi.json --key=API_KEY --id=API_SETTING_ID
# GitHub Action (🆕!)
- uses: readmeio/rdme@6
  with:
    rdme: openapi openapi.json --key=API_KEY --id=API_SETTING_ID
And here's what it looks like with the old GitHub Action:
# GitHub Action (legacy)
- uses: readmeio/github-readme-sync@v2
  with:
    readme-oas-key: 'API_KEY:API_SETTING_ID'
    oas-file-path: openapi.json

I think I prefer the npx notation to be honest, but there are a few benefits of this new wrapper we've created:

🧬 QA & Testing

I added a little workflow file for testing this GitHub Action integration and it works as expected. It checks out the oas-examples repo, checks out the current branch of rdme, and runs our validate and openapi commands against a petstore.json OAS file in a GitHub Action environment ✨ this should be comprehensive enough for our purposes, but I'm open to other ideas here!

Additionally, we now specify the User-Agent header based on the environment, so I added tests for that (and consolidated logic and improved tests for that code) in this PR.

You're welcome to try this out in a separate repo (see here for how I did it)... but if all tests pass then we should be good to go!

Fixes RM-3566

@kanadgupta kanadgupta marked this pull request as ready for review February 14, 2022 20:17
@kanadgupta
Copy link
Member Author

kanadgupta commented Feb 14, 2022

Marking this as ready for review! I've ticketed a bunch of tasks (see RM-1944's subtasks) that are still required for this (may happen in separate PRs), but I wanted to get feedback on this approach before I move forward with those.

Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been following the dev of this and hell yeah, amazing job, looks good to me, and hell yeah lets deprecate that sync workflow.

Copy link
Member

@gratcliff gratcliff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link

@rafegoldberg rafegoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn, that with: rdme usage is so clean…

@kanadgupta
Copy link
Member Author

Gonna merge this in and do additional work in separate PRs! See RM-1944 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants